package com.pc.admin.controller;



import com.pc.admin.dto.CelebritySaveDto;
import com.pc.admin.entity.CelebritySavePO;
import com.pc.admin.service.CelebritySaveService;
import com.pc.admin.util.CommonResult;
import com.pc.admin.vo.CelebrityTkIdVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/celebritySave")
@Api(tags = "保存数据类")
public class CelebritySaveController {


    @Autowired
    private CelebritySaveService celebritySaveService;





    @ApiOperation(value = "保存并更新")
    @PostMapping("/saveOrUpdate")
    public CommonResult<Integer> saveOrUpdate(@RequestBody List<CelebritySaveDto> list) {
        celebritySaveService.saveOrUpdate(list);
        return CommonResult.ok();
    }



    @ApiOperation(value = "查询tk_id列表")
    @GetMapping("/getTkIdList")
    public CommonResult<List<CelebrityTkIdVO>>  getTkIdList() {
        CommonResult<List<CelebrityTkIdVO>>  list = celebritySaveService.getTkIdList();
        return CommonResult.ok(list.getData());
    }






}
